%% test that record syntax still works with ECT

-module(record_tests).
-include_lib("ect/include/ect.hrl").

-record(rrr, {a, b, c}).

-export([dotest/0]).

dotest() ->
    R2 = modify(#rrr{a = secret_key, c = "pa", b = "ss"}),
    #rrr{c = "ss", b = "pa"} = R2,
    extract(R2).

modify(#rrr{b = B, c = C} = X) when X#rrr.a =:= secret_key ->
    X#rrr{b = C, c = B}.

extract(#rrr{a = secret_key, b = B, c = C}) ->
    list_to_atom(B++C).